﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DIProject.ReceptionGoods
{
    public partial class FillialForm : Form
    {
        public FillialForm()
        {
            InitializeComponent();
        }

        private void FillialForm_Load(object sender, EventArgs e)
        {
            DataSets.SettingsTableAdapters.DepartmentsTableAdapter adapter = new DIProject.DataSets.SettingsTableAdapters.DepartmentsTableAdapter();
            DataSets.Settings.DepartmentsDataTable data = adapter.GetData();
            cbDepartments.DataSource = data;
        }
        public string FillialName
        {
            get
            {
                if (cbDepartments.Items.Count < 1)
                    return string.Empty;
                DataRowView drv = cbDepartments.SelectedItem as DataRowView;
                DataSets.Settings.DepartmentsRow dr = drv.Row as DataSets.Settings.DepartmentsRow;
                return dr.Name;
            }
        }
    }
}